<template>
<header>
  <div class="head-inner">
  <div class="head-left" v-if='goBack'>
    <slot name='left'>
      <span @click="$router.go(-1)">返回</span>
    </slot>
  </div>
  <div class="head-title">{{title}}</div>
  <div class="head-right">
    <slot name='right'></slot>
  </div>
  </div>
</header>
</template>

<script>
  export default{
    name: 'home',
    components:{

    },
    props:{
      'goBack':{
        type: Boolean,
        default: true
      },
      'title':{
        type: String,
        required: true
      }
    },
    data () {
      return {
      }
    }
  }
</script>

<style lang="scss" scoped>
  @import '../../sass/variable.scss';
  header {
    box-sizing: border-box;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 100;
    background-color: $whi;
    width: 100%;
    height: 88px;
    overflow: hidden;
    // display: flex;
    // flex-flow: row nowrap;
    // justify-content: space-between;
    // align-content: center;
    // align-items: center;
    border: 1px solid #dcdcdc;
    /*no*/
    .head-inner {
      margin: 0 auto;
      // width: 96%;
      padding:0 3%;
      height: 100%;
      display: flex;
      flex-flow: row nowrap;
      justify-content: space-between;
      align-content: stretch;
      align-items: center;
      overflow: hidden;
    }
    .head-left {
      height: 100%;
      span {
        height: 100%;
        // position: relative;
        font-size: 30px;
        /*px*/
        display: flex;
        flex-flow: row nowrap;
        justify-content: space-between;
        align-content: center;
        align-items: center;
        color: $ora;
        &::before {
          content: "";
          display: inline-block; // position: absolute;
          width: 12px;
          height: 12px;
          border: 1px solid $ora;
          /*no*/
          border-width: 1px 0 0 1px;
          /*no*/
          transform: rotate(315deg); // top: 18px;
          // left: 12px;
        }
      }
    }
    .head-title {
      overflow: hidden;
      font-size: 34px;
      /*px*/
      text-align: center; // flex-grow:2;
      // margin: 0 5%;
      /*px*/
      position: absolute;
      margin: auto;
      left: 0;
      top: 0;
      bottom: 0;
      right: 0;
      line-height: 88px;
      z-index: -1;
    }
    .head-right {
      height: 100%;
      font-size: 30px;
      /*px*/
      text-align: center; // flex-grow:2;
      color: $ora;
      line-height: 88px;
    }
  }



</style>